﻿using System.Collections.Generic;
using System.Data;
using PPI.Data.Inspection;
using PPI.Entities.Interface;
using PPI.Mobile;

namespace PPI.ServiceLogic.Inspections
{
    public class LInspector : IMobileTable
    {
        public static DataSet SelectAll(string connectionKey)
        {
            return DInspectionInspector.SelectAll(connectionKey);
        }

        public List<EMobileQuery> CreateInsertMobileQuery(string connectionKey)
        {
            List<EMobileQuery> listQueries = new List<EMobileQuery>();
            listQueries.Add(new EMobileQuery("Delete tb_Inspectors"));
            DataTable dt = SelectAll(connectionKey).Tables[0];

            foreach (DataRow dr in dt.Rows)
                listQueries.Add(new EMobileQuery("Insert into tb_Inspectors(InspectorId,Name,CompanyFk) values(" + dr["InspectorId"] + ",'" + dr["Name"] + "', " + dr["CompanyFk"] + ") "));

            return listQueries;
        }
    }
}
